require('../less/init.css');
require('../less/style.less');
import { Picture, Setting } from "./data";
import engine from "./engine";
import render from "./render";
// window.r = render;
// window.e = engine;
window.imagePetting = {
    render(el: HTMLElement, setting: Setting ) {
        render.render(el, setting, (elWrap: HTMLDivElement) => {
            engine.bindEvent(elWrap);
            engine.emmitJumpPage = (page: number) => {
                render.listenerJumpPage(page);
                setting.listenerJumpIndex && setting.listenerJumpIndex(page - 1);
            }
            engine.init();
            setting.listenerReady && setting.listenerReady();
            return engine.initPos;
        });
    },
    jumpTo(page: number) {
        engine.pager.to(+page);
    },
    zoom(time: number) {
        engine.pager.zoom(time);
    },
    // _r: engine,
}